<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>录入人员信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<link href="css/style.css" rel="stylesheet" type="text/css"></link>
<link type="text/css" href="jquery/jquery-ui-1.8.19.custom.css" rel="stylesheet"></link>
<link rel="stylesheet" type="text/css" href="jquery/flexigrid.pack.css"></link>
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="jquery/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript" src="jquery/flexigrid.pack.js"></script>
<script src="script/commons.js" type="text/javascript"></script>
<script src="script/calendar.js" type="text/javascript"></script>
<script src="script/objects.js" type="text/javascript"></script>
<script type="text/javascript">
	var searchKey = '${s}';
	var isSearching = '${isSearching}';

	$(function(e) {
        if(isSearching == "searching") {
			$("#searchKey").val(searchKey);
		}
		var gridHeight = window.screen.availHeight - 350;
		$("#mainTable").flexigrid({height:gridHeight});
    });
	
	pager.currentPage = "${page.currentPage}";
	pager.action = "receiptallinfo.do";
	pager.getParam = function() {
		if(isSearching == "searching") {
			return "&s=" + $("#searchKey").val();
		}
		return "";
	};
	
	function doSearch(){
		to("receiptallinfo.do?s=" + $("#searchKey").val());
	}
</script>
<style type="text/css">
#searchTitle {
	position: relative;
	top: -1px;
	left: 45px;
	font-size: 13px;
}

#searchKey {
	padding-left: 45px;
	width: 150px;
}
</style>
</head>
<body>
	<form action="receiptallinfo.do" method="post">
        <div id="setWidth">
            <div class="button_bar">
                <input type="button" value="新增" onclick="to('forwardReceiptadd.do')">
                <input type="button" value="删除" onclick="deleteSelected('r', false)">
                <input type="button" value="记账" onclick="deleteSelected('r', true)">
                <label><span id="searchTitle">客户名:</span><input id="searchKey" name="searchKey" type="text">
                </label>
                <input type="button" value="查询" onclick="doSearch()">
            </div>
            <table id="mainTable"> <!--class="data_list_table"-->
                <thead>
                <tr>
                    <th width="20">
                    <input type="checkbox" style="vertical-align:middle" onclick="checkAllChecker()" ></th>
                    <th width="100">单据编号</th>
                    <th width="100">日期</th>
                    <th width="100">制单日期</th>
                    <th width="100">记账日期</th>
                    <th width="100">制单人</th>
                    <th width="150">渠道名称</th>
                    <th width="100">收款方式</th>
                    <th width="100">金额(元)</th>
                    <th width="100">备注</th>
                </tr>
                </thead>
                <tbody>
            <c:if test="${list!=null}" var="sel">
            <c:forEach var="list" items="${list}" varStatus="i">
            	<tr>
                    <td>
                    <c:if test="${list.isClosed == false}">
                    <input type="checkbox" name="checker" style="vertical-align:middle" value="${list.receiptId}"  onpropertychange="changeColor(this)" >
                    </c:if></td>
                    <td>
                    <c:if test="${list.isClosed == false}">
                    <a href="forwardReceiptadd.do?modifyId=${list.receiptId}">
                    </c:if>
                    A${list.receiptId}
                    <c:if test="${list.isClosed == false}">
                    </a>
                    </c:if>
                    </td>
                    <td>${list.receiptDate}</td>
                    <td>${list.writeDate}</td>
                    <td class="closeDate">
                    <c:choose>
                        <c:when test="${list.closeDate == null}">
                        -
                        </c:when>
                        <c:otherwise>
                        ${list.closeDate}
                        </c:otherwise>
                    </c:choose></td>
                    <td>${list.finUser.uname}</td>
                    <td>${list.finCustomer.customer}</td>
                    <td>${list.gatherWay}</td>
                    <td>${list.receiptPrince2}</td>
                    <td>${list.receiptRemark}</td>
                </tr>
            </c:forEach>
            </c:if>
            	</tbody>
            </table>
            <div class="footer">
                <a href="javascript:void()" onclick="pager.first()">
                <img alt="第一页" src="images/mainButton/pagefirst.gif" width="10px;" border="0px;">
                </a>
                <a href="javascript:void()" onclick="pager.previous()">
                <img alt="上一页" src="images/mainButton/pageprev.gif" width="60px;"
                    border="0px;">
                </a>
                <a href="javascript:void()" onclick="pager.next()">
                <img alt="下一页" src="images/mainButton/pagenext.gif" width="60px;"
                    border="0px;">
                </a>
                <a href="javascript:void()" onclick="pager.last()">
                <img alt="最后一页" src="images/mainButton/pageafter.gif" width="10px;"
                    border="0px;">
                </a>
                共${page.totalRows}条记录 每页 ${page.pageSize} 条 第 ${page.currentPage}
                页/共${page.totalPages}页
            </div>
    	</div>
	</form>
</body>

</html>